#pragma once

#include <Windows.h>
#include <string>
#include "types.h"
#include "chrono.h"
#include "dimension2d.h"
#include <boost/shared_ptr.hpp>

namespace sol9
{

	class renderer;
	typedef boost::shared_ptr<renderer> renderer_ptr;

	class application
	{
	private:
		std::tstring title;
		dimension2du size;
		HWND handle;
		WNDPROC proc;
		bool closed;

		chrono timer;
		u32 ticktime;

		renderer_ptr render;

	public:
		application(const std::tstring& _title, const sol9::dimension2du _size, WNDPROC _proc);
		~application();

		bool run();
		void close();

		u32 tick();

		void createRenderer();
		renderer_ptr getRenderer() const;

	private:
		bool _createWindow();
	};

} // namespace sol9